home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / contro2r / form3.frm < prev    next >
Text File  |  1999-04-06  |  3KB  |  98 lines

  1. VERSION 5.00
  2. Begin VB.Form Form3 
  3.    BorderStyle     =   1  'Fixed Single
  4.    Caption         =   "FindFirst"
  5.    ClientHeight    =   855
  6.    ClientLeft      =   45
  7.    ClientTop       =   330
  8.    ClientWidth     =   4695
  9.    LinkTopic       =   "Form3"
  10.    MaxButton       =   0   'False
  11.    ScaleHeight     =   855
  12.    ScaleWidth      =   4695
  13.    StartUpPosition =   3  'Windows Default
  14.    Begin VB.OptionButton Option4 
  15.       Caption         =   "FindPrevious"
  16.       Height          =   195
  17.       Left            =   3360
  18.       TabIndex        =   5
  19.       Top             =   120
  20.       Width           =   1215
  21.    End
  22.    Begin VB.OptionButton Option3 
  23.       Caption         =   "FindNext"
  24.       Height          =   195
  25.       Left            =   2280
  26.       TabIndex        =   4
  27.       Top             =   120
  28.       Width           =   975
  29.    End
  30.    Begin VB.OptionButton Option2 
  31.       Caption         =   "FindLast"
  32.       Height          =   195
  33.       Left            =   1200
  34.       TabIndex        =   3
  35.       Top             =   120
  36.       Width           =   975
  37.    End
  38.    Begin VB.OptionButton Option1 
  39.       Caption         =   "FindFirst"
  40.       Height          =   195
  41.       Left            =   120
  42.       TabIndex        =   2
  43.       Top             =   120
  44.       Value           =   -1  'True
  45.       Width           =   975
  46.    End
  47.    Begin VB.CommandButton findit 
  48.       Caption         =   "&Find"
  49.       Height          =   375
  50.       Left            =   3600
  51.       TabIndex        =   1
  52.       Top             =   360
  53.       Width           =   975
  54.    End
  55.    Begin VB.TextBox Text1 
  56.       BeginProperty Font 
  57.          Name            =   "Times New Roman"
  58.          Size            =   12
  59.          Charset         =   0
  60.          Weight          =   700
  61.          Underline       =   0   'False
  62.          Italic          =   0   'False
  63.          Strikethrough   =   0   'False
  64.       EndProperty
  65.       Height          =   375
  66.       Left            =   120
  67.       TabIndex        =   0
  68.       Top             =   360
  69.       Width           =   3255
  70.    End
  71. End
  72. Attribute VB_Name = "Form3"
  73. Attribute VB_GlobalNameSpace = False
  74. Attribute VB_Creatable = False
  75. Attribute VB_PredeclaredId = True
  76. Attribute VB_Exposed = False
  77. Private Sub findit_Click()
  78. Dim x As String
  79. x = "FileName" & "" & "='" & Text1.Text & ".ico'"
  80.     If Option1.Value = True Then Form1.Data1.Recordset.FindFirst x
  81.     If Option2.Value = True Then Form1.Data1.Recordset.FindLast x
  82.     If Option3.Value = True Then Form1.Data1.Recordset.FindNext x
  83.     If Option4.Value = True Then Form1.Data1.Recordset.FindPrevious x
  84.     If Form1.Data1.Recordset.NoMatch Then
  85.         MsgBox "No such record found", vbInformation, "dyr_workshop"
  86.     End If
  87. End Sub
  88.  
  89.  
  90. Private Sub Text1_KeyPress(KeyAscii As Integer)
  91. x = "FileName" & "" & "='" & Text1.Text & Chr(KeyAscii) & ".ico'"
  92.     If Option1.Value = True Then Form1.Data1.Recordset.FindFirst x
  93.     If Option2.Value = True Then Form1.Data1.Recordset.FindLast x
  94.     If Option3.Value = True Then Form1.Data1.Recordset.FindNext x
  95.     If Option4.Value = True Then Form1.Data1.Recordset.FindPrevious x
  96.     
  97. End Sub
  98.